<%--
    Document   : popuptemplate
    Created on : Jun 4, 2012, 2:47:19 PM
    Author     : ems
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>  
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <script type="text/javascript">        
            var open_cur = 0;      
            $j = jQuery.noConflict();
            function caps(id){
                document.getElementById(id).value = document.getElementById(id).value.toUpperCase();
            }
            $j(document).ready(function(){            
                $j('input#date').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                $j('input#leavedate1').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                $j('input#leavedate116').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                $j('input#leavedate11').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                $j('.keysearch1').live('keyup',function(){
                   
                    if($j('.keysearch1').val() == ""){
                        $j('.rich-table-row').show();
                                   
                    }else{
                        $j('.rich-table-row').hide();
                        $j('.rich-table-row').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.keysearch1').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                });
                
               
                $j(".buttonsave").live("click",function(){
                    if($j('.requiredF').val() == '' || $j('.requiredL').val() == ''  ){
                        // alert($j('.requiredF').val());
                        //  $j(".alert").text("(*) Không được để trống!!!");
                    }else{
                    
                        $j(".alert").text("");
                        if($j('.delay').css('display') != 'none')
                        {
                            $j('.demo').show();
                            $j('.demo').delay(6000).fadeOut('slow');
                        }
                    }                 
                }); 
        
                $j(".buttonsearch").live('click', function(){
                    $j(".research").show();
                });
            
                $j(".check_select1").live('click', function(){ 
                    
                    if($j(this).is(':checked')){ 
                        $j(".check_select1").attr('disabled',false);
                        var flagform2= '<c:out value="${customerExpand.flagForm}"/>';
                        iddd = $j(this).attr("lang");
                        $j('input[lang!='+iddd+'].check_select1').attr('checked',false);                   
                        $j(".mesage").text("");
                        showPleaseWait();
                        var cty = $j(this).parent().next().children().children().text();
                        var dchi = $j(this).parent().next().next().children().children().text();
                        var nn = $j(this).parent().next().next().next().children().children().text();
                       
                        if(flagform2==1){
                            PN100 = $j('#form-input-customerform\\:pn100').val(); 
                            $j.post("actionCustomerexpand.jsp?idEm=" + PN100 + "&iddd=" + iddd + "&cty=" + cty , function(data){                      
                                if(data!= null){
                                   
                                    $j(".mesage").text("Cập nhật thành công !");
                                    hidePleaseWait();
                                }
                            }); 
                        }else{
                            PN100 = $j('#formKHCN\\:pn100').val(); 
                            $j.post("actionCustomerexpand.jsp?idEm=" + PN100 + "&iddd=" + iddd + "&cty=" + cty , function(data){                      
                                if(data!= null){
                                    $j(".mesage").text("Cập nhật thành công !");
                                    hidePleaseWait();
                                }
                            });  
                        }
                        $j(this).attr('disabled',true);
                    }

                });
                var flagform= $j('#flagform').val();
                var choisetab = $j('#choisetab').val();
                var fk100 = $j('#fk100choise').val();
                var close = $j('#close').val();
                var ni = $j('#closeni').val();
                var pn100Clo = $j('#closeniPN100').val();
                 
                if(flagform==3||flagform==2){
                    $j("#form-input-customerform").css("display","none");
                }
                $j('#fancybox-close').live('click', function(){
                    if(flagform==1){
                        window.location.href="customerexpand.jsp";
                    }else if(flagform==2){
                        if(close ==1){
                            window.location.href="customer.jsp";
                        }else{
                            window.location.href="customer.jsp?action=linkCus&pnPN100="+pn100Clo+"&type="+ni; 
                        }
                           
                    }else if(flagform==3){
                        lDateTime = new Date().getTime();           
                     
                       
                   
                        if(choisetab==1)
                        {
                            window.location.href="cuscompany.jsp?tab=tab2"+ fk100 +"&flag="+lDateTime+"&#"+ fk100 +"";
                        }else{
                         
                       
                
                            window.location.href="cuscompany.jsp?tab=tab3"+ fk100 +"&flag="+lDateTime+"&#"+ fk100 +"";
                        }
                    }
                    
                }); 
                
                $j('.close111222').live('click', function(){
                    if(flagform==1){
                        window.location.href="customerexpand.jsp?<c:out value="${kapiMenu.md5url}"/>";
                    }else if(flagform==2){
                      
                        window.location.href="customer.jsp?<c:out value="${kapiMenu.md5url}"/>";     
                    }else if(flagform==3){
                        lDateTime = new Date().getTime();           
                       
                        if(choisetab==1)
                        {
                            window.location.href="cuscompany.jsp?tab=tab2"+ fk100 +"&flag="+lDateTime+"&#"+ fk100 +"";
                        }else{
                            var pk100 = $j(this).attr('lang');
                       
                
                            window.location.href="cuscompany.jsp?tab=tab3"+ fk100 +"&flag="+lDateTime+"&#"+ fk100 +"";
                        }
                    }
                });
                $j('.close111').live('click', function(){
                    if(flagform==1){
                        window.location.href="customerexpand.jsp?<c:out value="${kapiMenu.md5url}"/>";
                    }else if(flagform==2){
                        pn= $j(this).attr("lang");
                        pn1= $j(this).parent().attr("lang");
                         
                        window.location.href="customer.jsp?action=linkCus&pnPN100="+pn+"&type="+pn1;     
                    }else if(flagform==3){
                        lDateTime = new Date().getTime();           
                       
                        if(choisetab==1)
                        {
                            window.location.href="cuscompany.jsp?tab=tab2"+ fk100 +"&flag="+lDateTime+"&#"+ fk100 +"";
                        }else{
                            var pk100 = $j(this).attr('lang');
                       
                
                            window.location.href="cuscompany.jsp?tab=tab3"+ fk100 +"&flag="+lDateTime+"&#"+ fk100 +"";
                        }
                    }
                });
                
                //Save ajax N100
                $j('.saveN100AJ').live('click',function(){
                    nv115 =$j(this).parents().parents().find('.nv115').children('option:selected').val();//tieu de(gioi tinh)
                    nv102 =$j(this).parents().parents().find('.nv102').val();
                    nv103 =$j(this).parents().parents().find('.nv103').val();
                    nv123 =$j(this).parents().parents().find('.nv123').val();
                   
                    nv127 =$j(this).parents().parents().find('.nv127').val();
                    nd118 =$j(this).parents().parents().find('.nd118').val();
                    email =$j(this).parents().parents().find('.email').val();
                    mobi =$j(this).parents().parents().find('.mobi').val();
                    tel =$j(this).parents().parents().find('.tel').val();
                    nv130 =$j(this).parents().parents().find('.nv130').val();
                    fk300 =$j(this).parents().parents().find('.fk300').children('option:selected').val();
                    fk330 =$j(this).parents().parents().find('.fk330').children('option:selected').val();
                    fn100=$j(this).parents().parents().attr('lang');
                    fk100=$j('#form-input-customerform\\:fk100').val();
                    nn117=$j('#form-input-customerform\\:nn117').val();
                    fn600=$j('#form-input-customerform\\:FFN600').val();
                     
                    showPleaseWait();
                    $j.post('actionCompany.jsp?action=editCRM&nv115='+nv115+'&nv102='+nv102+'&nv103='+nv103+'&nv123='+nv123+'&nv127='+nv127+'&nd118='+nd118+'&email='+email+'&mobi='+mobi+'&tel='+tel+'&nv130='+nv130+'&fk300='+fk300+'&fk330='+fk330+'&fn100='+fn100+'&fk100='+fk100+'&nn117='+nn117+'&fn600='+fn600,function(data){
                        hidePleaseWait();
                        if(data>0){
                            $j('#form-input-customerform\\:pn100').val(data);
                            $j('.mesage').text("CẬP NHẬT THÀNH CÔNG !");
                        }else{
                            $j('.mesage').text("CẬP NHẬT THẤT BẠI !");
                        }
                    });
                  
                });
                //saveN100AJCUS
                $j('.saveN100AJCUS').live('click',function(){
                    nv115 =$j(this).parents().parents().find('.nv115').children('option:selected').val();//tieu de(gioi tinh)
                    nv102 =$j(this).parents().parents().find('.nv102').val();
                    nv103 =$j(this).parents().parents().find('.nv103').val();
                    nv123 = $j(this).parents().parents().find('.nv123').val();
                  
                    nv127 =$j(this).parents().parents().find('.nv127').val();
                    nd118 =$j(this).parents().parents().find('.nd118').val();
                    nd131 =$j(this).parents().parents().find('.nd131').val();
                    email =$j(this).parents().parents().find('.email').val();
                    mobi =$j(this).parents().parents().find('.mobi').val();
                    tel =$j(this).parents().parents().find('.tel').val();
                    nv130 =$j(this).parents().parents().find('.nv130').val();
                    fk300 =$j(this).parents().parents().find('.fk300').children('option:selected').val();
                    fk330 =$j(this).parents().parents().find('.fk330').children('option:selected').val();
                    fn100=$j(this).parents().parents().attr('lang');
                    fn100i = $j('#formKHCN\\:pn100').val();
                    fk100=$j('#formKHCN\\:fk100').val();
                  //  alert(fk100);
                    nn117=$j('#formKHCN\\:nn117').val();
                    fn600=$j('#formKHCN\\:FFN600').val();
                    idmobisave=$j('#formKHCN\\:idmobiSAVE').val();
                      
                    
                    showPleaseWait();
                    $j.post('actionCustomer.jsp?action=editCRM&nv115='+nv115+'&nv102='+nv102+'&nv103='+nv103+'&nv123='+nv123+'&nv127='+nv127+'&nd118='+nd118+'&email='+email+'&mobi='+mobi+'&tel='+tel+'&nv130='+nv130+'&fk300='+fk300+'&fk330='+fk330+'&fn100='+fn100+'&fk100='+fk100+'&nn117='+nn117+'&fn600='+fn600+'&nd131='+nd131+'&idmobi='+idmobisave+'&fn100i='+fn100i,function(data){
                        hidePleaseWait();
                        if(data>0){
                            $j('#formKHCN\\:pn100').val(data);
                            $j('.mesage').text("CẬP NHẬT THÀNH CÔNG !");
                        }else{
                            $j('.mesage').text("CẬP NHẬT THẤT BẠI !");
                        }
                    });
                });
            });

        </script>
    </head>


    <script type="text/javascript">
        $j = jQuery.noConflict();
        $j(document).ready(function(){
           
            
            $j(".buttonsave1").live('click', function(){
                $j(".mesage").text("");
                $j(".research").css('display','none');
                $j(".fromcareww").css('display','block');
                $j(".fromtim").css('display','none');
                $j(this).css('display','none');
                $j(".buttonsave2").css('display','block');
            });
            $j(".buttonsave2").live('click', function(){
                $j(".mesage").text("");
                $j(".research").css('display','block');
                $j(".fromcareww").css('display','none');
                $j(".fromtim").css('display','block');
                $j(this).css('display','none');
                $j(".buttonsave1").css('display','block');
            });
            
            $j(".email").bind('blur', function(){
                Email = $j(this).val();
                status = $j('.mesage');
                if(Email==''){
                    
                }else{
                    $j.post('actionCheckExist.jsp?action=checkExistEmail&email='+Email,function(data){
                   
                        if(data!=0){
                            $j('.mesage').text('Email đã có người sử dụng!!');
                        }else{
                            $j('.mesage').text('Có thể sử dụng Email này');
                        }
                    }); 
                }
                
               
            });
            
            
            $j(".mobi").bind('blur', function(){
                mobi = $j(this).val();
                if(mobi.indexOf(' ') != -1)
                {             
                    mobi1 =  mobi.replace(/ /g,'');
                    abc = $j(this).val(mobi1);
                    if(mobi1.indexOf('.') != -1){
                        mobi2 =  mobi1.replace(/\./g,'');
                        abc = $j(this).val(mobi2);
                        numericReg = /^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/;
                        if(!numericReg.test(mobi2)) {
                            $j('.mesage').text("Chỉ có thể nhập số");
                        }else{
                   
                            if(mobi2==''){
                    
                            }else{
                                $j.post('actionCheckExist.jsp?action=checkExistMobi&email='+mobi2,function(data){                  
                                    if(data!=0){                          
                                        $j('.mesage').text('Mobi đã có người sử dụng(không cập nhật dữ liệu)!!');
                                    }else{                         
                                        $j('.mesage').text('Có thể sử dụng mobi này');
                                    }
                                }); 
                            }   
                        }    
                    }else{
                        numericReg = /^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/;
                        if(!numericReg.test(mobi1)) {
                            $j('.mesage').text("Chỉ có thể nhập số");
                        }else{
                   
                            if(mobi1==''){
                    
                            }else{
                                $j.post('actionCheckExist.jsp?action=checkExistMobi&email='+mobi1,function(data){                  
                                    if(data!=0){                          
                                        $j('.mesage').text('Mobi đã có người sử dụng(không cập nhật dữ liệu)!!');
                                    }else{                         
                                        $j('.mesage').text('Có thể sử dụng mobi này');
                                    }
                                }); 
                            }   
                        }   
                    }
                }else if(mobi.indexOf('.') != -1){
                    mobi1 =  mobi.replace(/\./g,'');
                    abc = $j(this).val(mobi1);
                    if(mobi1.indexOf(' ') != -1){
                        mobi2 =  mobi1.replace(/ /g,'');
                        abc = $j(this).val(mobi2);
                        numericReg = /^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/;
                        if(!numericReg.test(mobi2)) {
                            $j('.mesage').text("Chỉ có thể nhập số");
                        }else{
                   
                            if(mobi2==''){
                    
                            }else{
                                $j.post('actionCheckExist.jsp?action=checkExistMobi&email='+mobi2,function(data){                  
                                    if(data!=0){                          
                                        $j('.mesage').text('Mobi đã có người sử dụng(không cập nhật dữ liệu)!!');
                                    }else{                         
                                        $j('.mesage').text('Có thể sử dụng mobi này');
                                    }
                                }); 
                            }   
                        }    
                    }else{
                        numericReg = /^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/;
                        if(!numericReg.test(mobi1)) {
                            $j('.mesage').text("Chỉ có thể nhập số");
                        }else{
                   
                            if(mobi1==''){
                    
                            }else{
                                $j.post('actionCheckExist.jsp?action=checkExistMobi&email='+mobi1,function(data){                  
                                    if(data!=0){                          
                                        $j('.mesage').text('Mobi đã có người sử dụng(không cập nhật dữ liệu)!!');
                                    }else{                         
                                        $j('.mesage').text('Có thể sử dụng mobi này');
                                    }
                                }); 
                            }   
                        }   }      
                }else{
                    numericReg = /^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/;
                    if(!numericReg.test(mobi)) {
                        $j('.mesage').text("Chỉ có thể nhập số");
                    }else{
                        if(mobi==''){
                    
                        }else{
                            $j.post('actionCheckExist.jsp?action=checkExistMobi&email='+mobi,function(data){                  
                                if(data!=0){                          
                                    $j('.mesage').text('Mobi đã có người sử dụng(không cập nhật dữ liệu)!!');
                                }else{                         
                                    $j('.mesage').text('Có thể sử dụng mobi này');
                                }
                            }); 
                        }  
                    }
                }                       
            });
        });
        
        function loadlaod(){
            alert("alo");
        }
    </script>
    <style type="text/css">
        .exist{
            color: red;
            float: left;
            margin-left: 98px;
            width: 271px;
        }
        .fromtim{
            float: left;
            width:100%;
            height: 30px;
            margin-bottom: 7px;
        }
        .alert1111{
            float:left;color: red;
            float: left;
            font-weight: bold;
            height: 20px;
            line-height: 20px;
            margin-bottom: 10px;
            margin-left: -100px;
            margin-top: 10px;
            max-height: 30px;
            overflow: hidden;
            position: absolute;
            text-align: center;
            width: 200px;
        }
        .bg_department{
            height: 68 !important;
        }
        .feild_sex td label{
            color:#4C4C4C;
        }
        #ui-datepicker-div
        {
            z-index: 9999999;
        }

        span img{
            height: 15px !important;
            width:15px !important;

        }
        .popup-content .main_content .form_item_content .edit_form_left .fields_input {
            float: left;

            width: 100%;
        }
        .alert{
            width:200px;
            height:20px;
            max-height:30px;
            overflow: hidden;
            float: left;
            line-height: 20px;
            font-weight: bold;
            text-align:center;
            color:red;
            margin-bottom: 10px;
            margin-top: 10px;
            position: absolute;
            margin-left: 209px;

        }
        .alert2{
            width:200px;
            height:20px;
            max-height:30px;
            overflow: hidden;
            float: left;
            line-height: 20px;
            font-weight: bold;
            text-align:center;
            color:red;
            margin-bottom: 10px;
            margin-top: 10px;
            position: absolute;
            margin-left: 209px;

        }
        .alert1{
            width:200px;
            height:20px;
            max-height:30px;
            overflow: hidden;
            float: left;
            line-height: 20px;
            font-weight: bold;
            text-align:center;
            color:red;
            margin-bottom: 10px;
            margin-top: 10px;
            position: absolute;
            margin-left: 209px;

        }
        .alertC{
            width:200px;
            height:20px;
            max-height:30px;
            overflow: hidden;
            float: left;
            line-height: 20px;
            font-weight: bold;
            text-align:center;
            color:red;
            margin-bottom: 10px;
            margin-top: 10px;
            margin-left: -100px;      
        }

        .buttonsavecmnd{
            background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
            border: 0 none;
            color: white;
            cursor: pointer;
            float: right;
            font-size: 15px;
            font-weight: bold;
            height: 28px;
            margin-right: 20px;
            margin-top: 9px;
            text-transform: uppercase;
            width: 75px;
        }

        .buttonsaveContact{
            background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
            border: 0 none;
            color: white;
            cursor: pointer;
            float: right;
            font-size: 15px;
            font-weight: bold;
            height: 28px;
            margin-right: 20px;
            margin-top: 9px;
            text-transform: uppercase;
            width: 75px;
        }
        .buttonsaveCompany{
            background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
            border: 0 none;
            color: white;
            cursor: pointer;
            float: right;
            font-size: 15px;
            font-weight: bold;
            height: 28px;
            margin-right: 20px;
            margin-top: 9px;
            text-transform: uppercase;
            width: 75px;
        }
        .buttonsaveCompany1{
            background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
            border: 0 none;
            color: white;
            cursor: pointer;
            float: right;
            font-size: 15px;
            font-weight: bold;
            height: 28px;
            margin-right: 20px;
            margin-top: 9px;
            text-transform: uppercase;
            width: 75px;
        }
        .buttonsaveAccount{
            background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
            border: 0 none;
            color: white;
            cursor: pointer;
            float: right;
            font-size: 15px;
            font-weight: bold;
            height: 28px;
            margin-right: 20px;
            margin-top: 9px;
            text-transform: uppercase;
            width: 75px;
        }
        .fast_search1{

            margin-left: 100px;
        }
        .text_search1{

        }
        .fast_search1 input[type="text"]{
            height: 26px;
            width:300px;
            border: 1px solid #138EF9;
            border-radius: 4px ;
            float:left;

        }
        .fast_search1 a img{
            cursor: pointer;
            height: 34px;
            margin-left: 5px;
            width: 45px;
            border-radius: 4px ;

        }
        .buttonsearch1{
            font-weight: bold;
            border:0;          
            width:56px; height:24px;
            color:#ffffff;
            border-radius: 2px 3px 2px 3px;
            cursor:pointer;
            text-transform:uppercase;
            background-color: #526171;
        }

        .title labe{
            width:23px;
        }
        .sort_char1 label{
            width:21px ;
            text-align: center;
        }
        .sort_char1 {
            text-align: center;
            font-size: 11px ;
            margin-right: 0 ;
        }
        .sort_char1 a{
            border: 1px solid #82A6C7  ;
            color: #266DB3 ;
            cursor: pointer ;
            display: inline-block ;
            line-height: 20px ;

        }
        .research{

            float: left;
            width:100%;
            height: auto;
            margin-bottom: 10px;
        }
        .mesage{
            color: red;
            float: left;
            margin-left: 252px;
            margin-top: 20px;
            text-transform: uppercase;

        }
        .namecompany{
            float:left;
            width:50% 
        }
        .carew{
            float:left;
            width:50% 
        }
        .db{
            margin-left: -10px !important;
        }
        .idd{
            color: white;
        }
        .addcarew{
            display:none;
        }
        .addcarew1{
            display:block;
        }
        .congty{
            /* width:120px;*/
        }
        .button{
            float: left;
            width:100%;
            height: 40px;
        }
        .select_cus td label{
            width: 79px !important;
            margin-left: 2px;
        }
        .select_cus td{
            width: 119px !important;
        }
        .fromcareww{
            display: none;
            margin-top: 26px;
        }

        .buttonsave1 {
            background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
            border: 0 none;
            color: white;
            cursor: pointer;
            float: left;
            font-size: 10px;
            font-weight: bold;
            height: 13px;
            margin-bottom: 5px;
            margin-left: 11px;
            padding: 4px 7px;
            text-transform: uppercase;
            width: auto;
        }
        .buttonsave2 {
            background: url("../images/button_left.gif") repeat-x scroll 0 0 transparent;
            border: 0 none;
            color: white;
            cursor: pointer;
            float: left;
            font-size: 10px;
            font-weight: bold;
            height: 13px;
            display: none;
            margin-left: 11px;
            padding: 4px 7px;
            text-transform: uppercase;
            width: auto;
            margin-bottom: 5px;
        }
        .message{
            color: red;
            float: left;
            margin-left: 202px;
            margin-top: 16px;
            text-align: center;
            font-weight: bold;
        }
        .header-box
        {
            width: 668px !important;
        }
        .greyRow{
            background: #E0EFFC;
        }
        .customer-box
        {
            width: 672px !important;
        }

        /*        .saveN950 {
                    height: 23px !important;
                    margin-top: 20px !important;
                    width: 60px !important;
                }*/


    </style>
    <f:view>
        <h:inputHidden value="#{kapiMenu.flagform}" id="flagform"/>
        <h:inputHidden value="#{kapiMenu.choisetab}" id="choisetab"/>
        <h:inputHidden value="#{CustomerBean.fk100}" id="fk100choise"/>
        <h:inputHidden value="#{CustomerBean.close}" id="close"/>
        <h:inputHidden value="#{CustomerBean.ni104}" id="closeni"/>
        <h:inputHidden value="#{CustomerBean.pn100}" id="closeniPN100"/>
        <body style=" float:left; width:auto; height:auto; margin:0px;">
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <div class="popup" style="height:auto; width:720px">
                <div class="popup-header">
                    <div class="title"><h:outputText value="#{locale.customer_company_add}"/></div>

                </div>
                <div class="popup-content">
                    <a4j:form id="formKHCN" rendered="#{customerExpand.flagForm != 1}">
                        <span class="header-box boder-bomttom"><h:outputText value="#{locale.job_info}"/></span>
                        <div class="customer-box" style="" lang="<h:outputText value="#{CustomerBean.pn100}"/>">
                            <h:panelGroup>                                   
                                <div class="form-left">
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.title}:"/></label>
                                        <h:selectOneMenu value="#{CustomerBean.nv108}" style="width:166px;" styleClass="nv115">  
                                            <f:selectItems value="#{CustomerBean.selectItems}" />  
                                        </h:selectOneMenu>

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.fname}"/>*:</label>&nbsp;
                                        <h:inputText value="#{CustomerBean.nv102}" onfocus="if(this.value=='NONAME') this.value='';" onkeyup="this.value=this.value.toUpperCase();" id="firstname" styleClass="required nv102">                                      
                                        </h:inputText>

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="Chữ lót"/>*:</label>&nbsp;
                                        <h:inputText value="#{CustomerBean.nv127}" onkeyup="this.value=this.value.toUpperCase();"  styleClass="required nv127">                                      
                                        </h:inputText>

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.lname}"/>*:</label>&nbsp;                                     
                                        <h:inputText value="#{CustomerBean.nv103}" onkeyup="this.value=this.value.toUpperCase();" id="lastname" lang="firstname" styleClass="required nv103"></h:inputText>
                                    </div>
                                    <div class="fields_input">                                       
                                        <label><h:outputText value="#{locale.dateBorn}"/>*:</label>&nbsp;
                                        <input type="text" id="leavedate1" name="leavedate1"  class="input_fields required date nd118"  
                                               value="<h:outputText value="#{CustomerBean.nd118}"> <f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>"/>

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="Nơi sinh"/>:</label>&nbsp;
                                        <h:inputText value="#{CustomerBean.nv123}" onkeyup="this.value=this.value.toUpperCase();" id="placedate1" lang="firstname" styleClass="requiredL nv123"></h:inputText>
                                    </div>
                                </div>

                                <div class="form-right">

                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.email}"/>:</label>&nbsp;
                                        <h:inputText value="#{CustomerBean.email}"   styleClass="required email"> 

                                        </h:inputText>

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.mobile}"/>:</label>&nbsp;
                                        <h:inputText value="#{CustomerBean.mobi}"   styleClass="required mobi">                                      
                                        </h:inputText>

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.tel}"/>:</label>&nbsp;
                                        <h:inputText value="#{CustomerBean.tel}"   styleClass="required tel">                                      
                                        </h:inputText>

                                    </div>

                                    <div class="fields_input">
                                        <label><h:outputText value="Nguồn thông tin" />:</label>&nbsp;
                                        <h:selectOneMenu value="#{CustomerBean.FK300}" style="width:166px;" styleClass="fk300">
                                            <f:selectItems value="#{CustomerBean.listComboK300}"/>
                                        </h:selectOneMenu>
                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="Trạng thái" />:</label>&nbsp;
                                        <h:selectOneMenu value="#{CustomerBean.FK330}" style="width:166px;" styleClass="fk330">
                                            <f:selectItems value="#{CustomerBean.listComboK330}"/>
                                        </h:selectOneMenu>
                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="Kế hoạch tháng" />:</label>&nbsp;
                                        <input type="text" id="leavedate11" name="leavedate11"  class="input_fields required date nd131"  
                                               value="<h:outputText value="#{CustomerBean.dateStatus}"> <f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>"/>
                                    </div>

                                </div>
                                <div style="width:94%;float:left;margin-left: 14px;">
                                    <label style="margin-top:10px;"><h:outputText value="#{locale.notice1}" />:</label>
                                    <h:inputTextarea value="#{CustomerBean.notice}" cols="20" styleClass="nv130" style="margin-top:8px;margin-left: 9px;width: 519px;" ></h:inputTextarea>
                                </div>
                                <%-- <div style="float: left;margin-left: 15px;width:90%">
                            <div class="fields_input">
                                <label> <h:outputText value="#{locale.customertype}"/>:</label>
                                <h:selectOneRadio value="#{CustomerBean.ni104}" styleClass="select_cus" id="select_cus_ck" style="width:228px;" >
                                    <f:selectItem  itemValue="1" itemLabel="#{locale.customer_tt}"/> 
                                    <f:selectItem id="tn" itemValue="0" itemLabel="#{locale.customer_tn}"  />
                                </h:selectOneRadio>
                            </div>
</div>--%>
                                <div class="popup-footer">
                                    <div  class="buttonsave saveN100AJCUS">
                                        <h:outputText value='#{locale.save}' style="margin-right:22px;"/>
                                    </div>  
                                    <h:inputHidden id="FFN600" value="#{CustomerBean.FN600}" />
                                    <h:inputHidden id="FK100" value="#{CustomerBean.fk100}" /> 
                                    <h:outputText value="#{CustomerBean.message}" id="mesage3" styleClass="mesage"/>
                                    <%--    <a4j:commandButton onclick="showPleaseWait();"  action="#{CustomerBean.saveCustomer}"  oncomplete="hidePleaseWait();$j('.messa').text('');"  styleClass="buttonsave savewait" value="#{locale.save}" reRender="lang,mesage3,pn100,formcompany">

                                    </a4j:commandButton>--%>
                                    <h:inputHidden value="#{CustomerBean.flag}" id="flag" />
                                    <h:inputHidden value="#{CustomerBean.pn100}" id="pn100" />
                                    <h:inputHidden value="#{CustomerBean.editpage}" id="editpage"/>
                                    <h:inputHidden value="#{CustomerBean.idmobiSAVE}" id="idmobiSAVE" />
                                    <h:inputHidden value="#{CustomerBean.fn850}" id="fn850" />
                                    <h:inputHidden value="#{CustomerBean.nv113}" id="nv113" />                                       
                                    <h:inputHidden value="#{CustomerBean.ni105}" id="ni105" />
                                    <h:inputHidden value="#{CustomerBean.nn117}" id="nn117" />


                                </div>


                            </h:panelGroup>                          
                            <!-- End List Content-->
                        </div>

                    </a4j:form>
                    <a4j:form id="form-input-customerform">
                        <span class="header-box boder-bomttom"><h:outputText value="#{locale.job_info}"/></span>
                        <div class="customer-box" style="" lang="<h:outputText value="#{customerExpand.PN100}"/>">
                            <h:inputHidden value="#{customerExpand.flagExpand}" id="flagExpand"/>
                            <h:inputHidden value="#{customerExpand.fk100}" id="fk100"/>
                            <h:inputHidden value="#{customerExpand.NN117}" id="nn117" />
                            <h:inputHidden value="#{customerExpand.FN600}" id="FFN600" />
                            <h:panelGroup id="message2" >
                                <div style="float:left; width:50%;">
                                    <div class="fields_input">
                                        <%--<h:outputText value="#{customerExpand.NV102}"/>/ <h:outputText value="#{customerExpand.NV101}"/>--%>
                                        <label><h:outputText value="Tiêu đề "/></label>
                                        <h:selectOneMenu value="#{customerExpand.NV115}" style="width:166px;margin-left:9px; height:21px" styleClass="nv115">
                                            <f:selectItems value="#{customerExpand.selectItems}" />
                                        </h:selectOneMenu>

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.fname}"/>*:</label>&nbsp;
                                        <h:inputText value="#{customerExpand.NV102}" onkeyup="this.value=this.value.toUpperCase();" id="firstname" styleClass="requiredF nv102">
                                            <h:message for="firstname"/>
                                        </h:inputText>

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="Chữ lót"/>:</label>&nbsp;
                                        <h:inputText value="#{customerExpand.NV127}" styleClass="nv127" onkeyup="this.value=this.value.toUpperCase();" id="middlename" >
                                            <h:message for="middlename"/>
                                        </h:inputText>

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.lname}"/>*:</label>&nbsp;
                                        <h:inputText value="#{customerExpand.NV103}" onkeyup="this.value=this.value.toUpperCase();" id="lastname" lang="firstname" styleClass="requiredL nv103"></h:inputText>
                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.dateBorn}"/>:</label>&nbsp;
                                        <input type="text" id="date" name="date"  class="input_fields required date nd118"  
                                               value="<h:outputText value="#{customerExpand.nd118}"> <f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>"/>
                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="Nơi sinh"/>:</label>&nbsp;
                                        <h:inputText value="#{customerExpand.nv123}" onkeyup="this.value=this.value.toUpperCase();" id="placedate" lang="firstname" styleClass="requiredL nv123"></h:inputText>
                                    </div>
                                </div>


                                <div style="float:left; width:50%;">                                   

                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.email}" />:</label>&nbsp;
                                        <h:inputText value="#{customerExpand.email}" styleClass="email" />

                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.mobile}" />:</label>&nbsp;
                                        <h:inputText value="#{customerExpand.mobi}" styleClass="number mobi" />
                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="#{locale.tel}" />:</label>&nbsp;
                                        <h:inputText value="#{customerExpand.tel}" styleClass="number tel" />
                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="Nguồn" />:</label>&nbsp;
                                        <h:selectOneMenu value="#{customerExpand.FK300}" style="width:166px;" styleClass="fk300">
                                            <f:selectItems value="#{customerExpand.listComboK300}"/>
                                        </h:selectOneMenu>
                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="Status" />:</label>&nbsp;
                                        <h:selectOneMenu value="#{customerExpand.FK330}" style="width:166px;" styleClass="fk330">
                                            <f:selectItems value="#{customerExpand.listComboK330}"/>
                                        </h:selectOneMenu>
                                    </div>
                                    <div class="fields_input">
                                        <label><h:outputText value="Kế hoạch tháng" />:</label>&nbsp;
                                        <input type="text" id="leavedate116" name="leavedate116"  class="input_fields required date nd131"  
                                               value="<h:outputText value="#{customerExpand.ND131}"> <f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>"/>
                                    </div>
                                </div>

                                <div style="width:100%;float:left;">
                                    <label style="margin-top:10px;"><h:outputText value="#{locale.notice1}" />:</label>
                                    <h:inputTextarea value="#{customerExpand.nv130}" cols="20" styleClass="nv130" style="margin-top:8px;margin-left: 9px;width: 502px;" ></h:inputTextarea>
                                </div>

                            </h:panelGroup>
                            <div class="popup-footer" style="height:40px;">
                                <h:outputText value="#{customerExpand.message}" id="mesage" styleClass="mesage"/>
                                <div  class="buttonsave saveN100AJ">
                                    <h:outputText value='#{locale.save}' style="margin-right:22px;"/>
                                </div>  
                                <%-- <a4j:commandButton  value='#{locale.save}'  action="#{customerExpand.saveN100andN590}"
                                                     onclick="showPleaseWait();"
                                                     oncomplete="hidePleaseWait();$j('.messa').text('');" 
                                                     styleClass="buttonsave" reRender="mesage,pn100,formcompany" >

                                </a4j:commandButton>--%>


                            </div>
                            <!-- End List Content-->
                        </div>
                        <h:inputHidden id="pn100" value="#{customerExpand.PN100}"/>
                    </a4j:form>
                    <%-- Start Load ajax form postN950Ajax(forder Index) --%>
                    <h:panelGroup id="contact" >
                        <span class="header-box contactN950"><h:outputText value="#{locale.contact_info}"/></span>
                        <div class="customer-box" style="display:none;">
                            <div class="customer-boxcontact">

                            </div>
                        </div>
                    </h:panelGroup>
                    <%-- End Load ajax form postN950Ajax(forder Index) --%>
                    <!-- giay to tuy than -->
                    <span class="header-box infoN350" ><h:outputText value="#{locale.papers_person}"/></span>
                    <div class="customer-box" style="display:none">
                        <div class="customer-boxN350">
                            <!-- Danh cho from contact N950 ------------------------------------------>
                        </div>
                    </div>
                    <!-- end giay to tuy than -->

                    <h:panelGroup id="account">
                        <span class="header-box acountT025" ><h:outputText value="#{locale.bank_account}"/></span>

                        <div class="customer-box" style="display:none">

                            <div class="customer-boxacount">
                                <!-- Danh cho from contact N950 ------------------------------------------>
                            </div>
                        </div>
                    </h:panelGroup>

                    <h:panelGroup id="accountnoibo">
                        <span class="header-box customerK100"><h:outputText value="#{locale.orther_info}"/></span>

                        <div class="customer-box" style="display:none">

                            <div class="customer-boxcustomer">
                                <!-- Danh cho from contact N950 ------------------------------------------>
                            </div>
                        </div>
                    </h:panelGroup>

                    <h:panelGroup>
                        <span class="header-box companyCRM"><h:outputText value="#{locale.company}"/></span>
                        <div class="customer-box " style="display:none">
                            <div class="customer-companyCRM">
                                <!-- Danh cho from contact comnpoay ------------------------------------------>
                            </div>
                        </div>
                    </h:panelGroup>
                    <div class="messa" style=" margin-left: 89px;margin-top: 368px !important;">                                
                        <h:outputText id="message" value="#{locale.please_save_customer}" style="display:none;margin-left:200px;color:red;font-weight:bold;font-style:italic;" styleClass="messa"/>
                        <h:outputText id="FK100E" value="#{customerExpand.FK100E}" style="display:none" styleClass="FK100E"/>

                    </div>

                </div>


                <div class="popup-footer" lang="<h:outputText value="#{CustomerBean.ni104}"/>">
                    <h:panelGroup rendered="#{CustomerBean.close != 1}"><div class="buttonsave close111" lang="<h:outputText value="#{CustomerBean.pn100}"/>"  style="" onclick="parent.jQuery.fancybox.close(); "  ><span><h:outputText value="#{locale.button_close}"/></span></div></h:panelGroup>
                    <h:panelGroup rendered="#{CustomerBean.close == 1}"><div class="buttonsave close111222" lang="<h:outputText value="#{CustomerBean.pn100}"/>"  style="" onclick="parent.jQuery.fancybox.close(); "  ><span><h:outputText value="#{locale.button_close}"/></span></div></h:panelGroup>
                </div>            


            </div>
        </body>

    </f:view>
</html>
<script type="text/javascript">
    $j(document).ready(function(){
        yhight = ($j('.popup').height()-90)+"px" ;
        $j('.main_content').css('height',yhight );
        $j('.popup-content').css('height',yhight );
    });
    $j(document).ready(function(){
        var idk100= '#k100-'+$j('.FK100E').text();
        //alert(idk100);
        $j(idk100).attr('checked',true);
        $j(idk100).attr('disabled',true);
    });
</script>